1. Field of the Invention
The present invention relates generally to magnetic disk drives and, more particularly, to a method of managing the reading or writing of audiovisual data from the disk drive in accordance with the absence or presence of an urgent condition.
2. Description of the Related Art
Personal computer (PC) makers have adopted magnetic disk drives as the mass storage device of choice, on an almost universal basis, because of their speed, capacity, and low cost.
The most popular standard for interfacing a host computer with a disk drive is the Enhanced Integrated Drive Electronics (EIDE) or AT Attachment-2 (ATA-2) specification. Under the EIDE specification, the host PC commands the magnetic disk drive to read data from or write data to the disk drive starting at a particular xe2x80x9csectorxe2x80x9d location on the drive""s rotating media and continuing for a specified number of xe2x80x9csectorsxe2x80x9d ranging from only 1 sector to as many as 256 sectors. Sector size may differ from drive to drive, but a standard sector has come to contain 512 bytes of data. The location of a particular sector may be specified as a physical location (e.g. a particular Cylinder, Head, and Sector or CHS location), or, as is now more common, as a logical location (e.g. a particular Logical Block Address or LBA) that the drive translates into a physical location.
The conventional EIDE disk drive reads or writes sectors as commanded by the host PC. It does not xe2x80x9cknowxe2x80x9d that any particular sector is associated with any particular data file (or AV objects as discussed below) because the host PC""s operating system is solely responsible for keeping track of the association between sectors and data files (or AV objects). The typical host PC is controlled by an operating system that:
(1) maintains a file directory containing a list of file names and associated xe2x80x9cstartxe2x80x9d clusters (aka xe2x80x9callocation unitsxe2x80x9d, one cluster or one allocation unit being a particular number of sectors);
(2) maintains a separate xe2x80x9clinked listxe2x80x9d of clusters; and
(3) instructs the drive where to read or write such clusters based on a start cluster from (1) and, if necessary, from the linked list of subsequent clusters from (2).
One familiar structure of this nature is the directory and associated file allocation table (FAT) first introduced in the well-known disk operating system called DOS.
While speed is always desirable, nothing catastrophic would occur if a disk drive were delayed in reading or writing a particular cluster of a standard data file due to multiple retries and the like. The overall data file would just be read from or written to the disk later than normal. Accordingly, a conventional disk drive that stores only standard data files operates with more emphasis on making sure that it accurately reads or writes the data rather than on making sure that it reads or writes the data with any sort of urgency.
However, disk drives traditionally used for storing standard discrete data files have recently become viable candidates for also storing and playing back audiovisual objects (e.g. movies or songs). It has become practical to store audiovisual objects on such disk drives because of the ever-increasing capacity of consumer-priced disk drives (exceeding 20 GB at the present time) and the emergence of ever more practical compression techniques for audiovisual objects (e.g. video images compressed according to the standards promulgated by the Motion Picture Experts Group such as MPEG-2 or audio tracks compressed according to the MP3 format). A 20 GB drive, in fact, has sufficient capacity to store about 5-20 hours of video data using readily available hardware and/or software compression techniques and depending on desired quality.
Unlike a data file, the reading and writing of AV data corresponding to an xe2x80x9caudiovisual objectxe2x80x9d is very time sensitive. For this reason, the xe2x80x9cflowxe2x80x9d of data making up an audiovisual object is often regarded as an audiovisual data stream. As suggested by the terminology, an AV data stream is a long, continuous series of AV data groups that must each be handled in a timely manner or be irretrievably dropped. When writing to the disk drive, for example, the AV data stream may flow relentlessly into the disk drive without regard to the status of the drive""s write-cache (likely shared between streams) and whether or not the disk drive has written the preceding AV data from the cache to the media. A failure to write the incoming AV data in a timely manner may result in an xe2x80x9coverflowxe2x80x9d situation drive""s buffer memory whereby some of the AV data is lost. Similarly, when reading AV data from the disk drive for playing back a movie or song, the playback device has a relentless need for new video frames or audio segments regardless of whether or not the disk drive has read the succeeding AV data corresponding to the new frames or segments and stored such data in the read-ahead cache. Under certain drive conditions, such as when the host is recording and/or playing back multiple AV streams, a failure to have the required AV data pre-loaded in the read-ahead cache may result in skipped frames or segments that are visually or audibly annoying to the user.
A disk drive used for storing audiovisual data streams is likely to be used for storing conventional data files too. A conventional disk drive uses only one head at a time. Nonetheless, given sufficient capacity and speed, a dual-purpose disk drive may xe2x80x9csimultaneouslyxe2x80x9d read and write multiple data files while processing multiple AV data streams. The drive may, for example, rapidly turn its attention to the successive operations needed for loading a spreadsheet file into memory, storing one AV data stream, and playing back another AV data stream.
A disk drive that is adapted for storing an AV data stream may have insufficient opportunity from time to time, due to having to tend to other drive operations, to ensure that the AV data is accurately written to or read from the drive. In apparent acknowledgment of this concern, others have proposed toggling the drive between two major modes:
(1) a default data mode designed to accurately transfer data files to or from the disk with conventional error recovery routines such as multiple retries, and the like, fully enabled; and
(2) a default AV mode designed to rapidly transfer AV data streams to or from the disk with suitable time limitations, and the like, imposed on the normal error recovery routines.
Because the disk drive normally stops transferring data altogether upon detecting an error, it has also been proposed that the default AV mode includes an optional xe2x80x9cread continuousxe2x80x9d mode wherein the AV data stream is continuously transferred notwithstanding such an error, without stopping to perform error recovery procedures, since transmitting some erroneous AV data may be better than transferring no data at all.
The foregoing provision of a default AV mode, including a read continuous mode, beneficially tends to transfer an AV data stream in an expedient manner. The default AV mode of this nature, however, does not consider the possibility that unavoidably xe2x80x9curgentxe2x80x9d situations may arise in the host, or in the disk drive itself, with respect to the A/V data stream where there is only one or with respect to a particular AV data stream where there are several. The host, for example, may include a receive buffer that stores a certain amount of AV data previously read from the disk drive to accommodate the need to immediately display such data and the possibility that the disk drive will take longer than expected to transfer later requested information. The host""s receive buffer may become near-empty and create an xe2x80x9curgentxe2x80x9d condition from the host""s point of view. As another example, the disk drive itself may have a read-ahead buffer that is used to temporarily store data that the drive anticipates the host will request based, for example, on such data being stored at disk locations that are immediately consecutive to the location of previously requested data. The drive""s read-ahead buffer may also become near-empty, the latter condition being a potentially urgent condition from the drive""s point of view.
In view of the above, there remains a need for a disk drive that is adapted for reading and writing an AV data stream with less probability of dropping data.
This invention can be regarded as a unique method of operating a disk drive that is adapted for storing an audiovisual data stream on a disk and for rapidly reading or writing successive portions of the audiovisual data stream in response to commands that arrive from a host under a variety of operational circumstances including other drive operations and includes the step of setting (202) a default operating mode for responding to the commands which gives standard precedence to transferring the audiovisual data stream relative to attending to another drive operation, the default operating mode including a read continuous mode which causes the disk drive to continuously read successive portions of a subsequently requested audiovisual data stream without regard to error. The innovative method comprises the further steps of: receiving (204) a new transfer command requiring the transfer of a data segment associated with the audiovisual data stream; determining (206) an absence or presence of an urgent condition with regard to the new transfer command; according standard precedence (220) to processing the audiovisual data stream associated with the new transfer command as specified by the default operating mode in the determined absence of the urgent condition; and according urgent precedence (230) to processing the audiovisual data stream associated with the new transfer command over attending to the other drive operation in the determined presence of the urgent condition without regard to the default operating mode.